<div
        style="color: #cccccc; background-color: #1f1f1f; font-family: Consolas, 'Courier New', monospace; line-height: 19px; white-space: pre;">
        <div style="line-height: 19px;">
                <div><span style="color: #c586c0;">from</span> datetime <span style="color: #c586c0;">import</span>
                        datetime</div>
                <div><span style="color: #c586c0;">from</span> dateutil.tz <span style="color: #c586c0;">import</span>
                        tzutc</div> <br />
                <div><span style="color: #569cd6;">def</span> <span
                                style="color: #dcdcaa;">preprocess_status</span>(<span
                                style="color: #9cdcfe;">status</span>):</div>
                <div>&nbsp; &nbsp; processed_status <span style="color: #d4d4d4;">=</span> <span
                                style="color: #ce9178;">''</span></div>
                <div>&nbsp; &nbsp; <span style="color: #c586c0;">for</span> key, value <span
                                style="color: #c586c0;">in</span> status.items():</div>
                <div>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #c586c0;">if</span> key <span
                                style="color: #d4d4d4;">==</span> <span style="color: #ce9178;">'running'</span> <span
                                style="color: #569cd6;">and</span> value <span style="color: #569cd6;">is</span> <span
                                style="color: #569cd6;">not</span> <span style="color: #569cd6;">None</span>:</div>
                <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processed_status<span style="color: #d4d4d4;">+=</span>
                        (<span style="color: #ce9178;">"running: started_at "</span> <span
                                style="color: #d4d4d4;">+</span> value[<span
                                style="color: #ce9178;">'started_at'</span>].strftime(<span
                                style="color: #ce9178;">'%Y-%m-</span><span style="color: #569cd6;">%d</span><span
                                style="color: #ce9178;"> %H:%M:%S %Z'</span>))</div>
                <div>&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #c586c0;">else</span>:</div>
                <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processed_status<span style="color: #d4d4d4;">+=</span>
                        (key<span style="color: #d4d4d4;">+</span><span style="color: #ce9178;">": "</span><span
                                style="color: #d4d4d4;">+</span>value)<span style="color: #c586c0;">if</span> value
                        <span style="color: #d4d4d4;">!=</span><span style="color: #569cd6;">None</span> <span
                                style="color: #c586c0;">else</span> key<span style="color: #d4d4d4;">+</span><span
                                style="color: #ce9178;">": None"</span></div>
                <div>&nbsp; &nbsp; &nbsp; &nbsp; processed_status<span style="color: #d4d4d4;">+=</span><span
                                style="color: #ce9178;">'</span><span style="color: #d7ba7d;">\n</span><span
                                style="color: #ce9178;">'</span></div>
                <div>&nbsp; &nbsp; <span style="color: #c586c0;">return</span> processed_status</div> <br />
                <div><span style="color: #6a9955;"># 示例状态值</span></div>
                <div>status_value <span style="color: #d4d4d4;">=</span> {</div>
                <div>&nbsp; &nbsp; <span style="color: #ce9178;">'running'</span>: {<span
                                style="color: #ce9178;">'started_at'</span>: datetime(<span
                                style="color: #b5cea8;">2024</span>, <span style="color: #b5cea8;">3</span>, <span
                                style="color: #b5cea8;">10</span>, <span style="color: #b5cea8;">19</span>, <span
                                style="color: #b5cea8;">4</span>, <span style="color: #b5cea8;">57</span>, <span
                                style="color: #9cdcfe;">tzinfo</span><span style="color: #d4d4d4;">=</span>tzutc())},
                </div>
                <div>&nbsp; &nbsp; <span style="color: #ce9178;">'terminated'</span>: <span
                                style="color: #569cd6;">None</span>,</div>
                <div>&nbsp; &nbsp; <span style="color: #ce9178;">'waiting'</span>: <span
                                style="color: #569cd6;">None</span></div>
                <div>}</div> <br />
                <div><span style="color: #6a9955;"># 预处理状态值</span></div>
                <div>processed_status_value <span style="color: #d4d4d4;">=</span> preprocess_status(status_value)</div>
                <br />
                <div><span style="color: #dcdcaa;">print</span>(processed_status_value)</div>
        </div>
</div>